package com.ruoyi.procured.domain;

import java.math.BigDecimal;
import java.util.Arrays;
import java.util.List;
import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.ProcuredOrders;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 采购计划对象 tb_procured_plan
 * 
 * @author ruoyi
 * @date 2023-11-03
 */
@Data
@TableName(value="tb_procured_plan")
public class ProcuredPlan extends BaseEntity
{
    private static final long serialVersionUID = 1L;
    @TableId(value = "plan_id")
    /** 采购计划id */
    private Long planId;

    /** 采购单号 */
    @TableField("plan_number")
    @Excel(name = "采购单号")
    private String planNumber;

    /** 采购日期 */
    @TableField("plan_date")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "采购日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date planDate;

    /** 关联供应商表(tb_vendor) */
    @TableField("vendor_id")
    @Excel(name = "关联供应商表(tb_vendor)")
    private Long vendorId;

    /** 关联机构管理表(tb_company) */
    @TableField("company_id")
    @Excel(name = "关联机构管理表(tb_company)")
    private Long companyId;

    /** 关联部门表(sys_dept) */
    @TableField("dept_name")
    @Excel(name = "关联部门表(sys_dept)")
    private String deptName;

    /** 关联用户表(sys_user) */
    @TableField("user_name")
    @Excel(name = "关联用户表(sys_user)")
    private String userName;

    /** 关联预入仓库表(tb_pre_warehouse) */
    @TableField("warehouse_id")
    @Excel(name = "关联预入仓库表(tb_pre_warehouse)")
    private Long warehouseId;

    /** 关联货币单位表(tb_monetary) */
    @TableField("monetary_id")
    @Excel(name = "关联货币单位表(tb_monetary)")
    private Long monetaryId;

    /** 计划状态 */
    @TableField("plan_status")
    @Excel(name = "计划状态")
    private String planStatus;



    /** 关联合同模板分类表(tb_contract_templates) */
    @TableField("templates_id")
    @Excel(name = "关联合同模板分类表(tb_contract_templates)")
    private Long templatesId;


    /** 合同 */
    @TableField("contract")
    @Excel(name = "合同")
    private String contract;

    /** 备注 */
    @TableField("plan_remark")
    @Excel(name = "备注")
    private String planRemark;

    /** 交货地址 */
    @TableField("delivery_address")
    @Excel(name = "交货地址")
    private String deliveryAddress;

    /** 删除状态 0存在1删除 */
    @TableField("delete_status")
    private String deleteStatus;

    /** 添加时间 */
    @TableField(value = "add_time",exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date addTime;

    /** 核准人 */
    @TableField("approver")
    private String approver;

    /** 核准日期 */
    @TableField("approved_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date approvedTime;

    /** 总件数 */
    @TableField("total")
    private Long total;

    /** 参考金额 */
    @TableField("total_amount")
    private BigDecimal totalAmount;

    /** 实际金额 */
    @TableField("actual_amount")
    private BigDecimal actualAmount;

    /** 仓库名称 */
    @TableField(exist = false)
    private String warehouseName;

    /** 供应商名称 */
    @TableField(exist = false)
    private String name;

    /** 机构管理名称 */
    @TableField(exist = false)
    private String companyName;

    /** 货币单位名称 */
    @TableField(exist = false)
    private String monetaryName;

    /** 销售计划编号 */
    @TableField("sales_plan_number")
    private String salesPlanNumber;

    /** 版本号 */
    @TableField("version")
    private Integer version;

    /**  当前审核用户ID */
    @TableField("reviewer_user_id")
    private Long reviewerUserId;

    /**  撤回备注 */
    @TableField("revoke_remark")
    private String revokeRemark;

    /** 销售计划id */
    @TableField(exist = false)
    private Long salesPlanId;

    /**
     * 汇率
     */
    @TableField(value = "currency",exist = false)
    private BigDecimal currency;


    /**
     * 运费
     */
    @TableField(value = "freight",exist = false)
    private BigDecimal freight;

    /**
     * 采购订单分批下单备注
     */
    @TableField(value = "purchaseOrderRemark",exist = false)
    private String purchaseOrderRemark;

    /**
     * 运费是否是自己掏腰包
     */
    @TableField(exist = false)
    private Boolean flag;

    /**
     * 优惠金额
     */
    @TableField(value = "discount_amount",exist = false)
    private BigDecimal discountAmount;

    /**
     * 采购计划中包含的采购订单信息
     */
    @TableField(exist = false)
    private List<ProcuredOrders> procuredOrders;


    /** 原来采购计划商品id */
    @TableField(exist = false)
    private Long[] shipmentsProductIds;

    /** $table.subTable.functionName信息 */
    @TableField(exist = false)
    private List<TbProcuredProduct> tbProcuredProductList;

    /** 采购计划分批下单的时候传递过来的下单产品信息 */
    @TableField(exist = false)
    private List<TbProcuredProduct> batchOrderProductList;

}
